A time-sharing microcomputer system has been proposed that simultaneously performs multiple tasks, one of which is a system task for controlling the entire behavior of the microcomputer system. If the system task runs away out of control, the microcomputer system is wholly affected by the system task runaway. Therefore, the system task is highly prioritized.
Generally, a watchdog timer is used to detect the system task runaway. However, the watchdog timer causes a relatively large time lag between occurrence and detection of the system task runaway. Accordingly, the runaway condition lasts for a relatively long time. As a result, the microcomputer system may be significantly affected by the system task runaway.
U.S. Pat. No. 6,304,957 corresponding to JP-A-6-250855 and JP-A-6-250857 discloses a technique for detecting a task runaway by using a check code embedded in a portion of an instruction code. The technique determines whether, based on the check code, an instruction fetched by a central processing unit indicates a task to be executed at the present time. However, the number of instruction codes available is finite. Therefore, when the portion of the instruction code is used as the check code, the number of instruction codes available is reduced.